package com.mazaiting.cryption.sm.sm4;

/**
 * SM4 上下文
 * 源码: https://github.com/SmartXiaoMing001/Chinese-Cipher-Of-SM2-SM3-SM4
 */
public class SM4Context {
    /**
     * 加解密模式
     */
    private int mode;
    /**
     * 密钥 key 数组
     */
    private final long[] sk;
    /**
     * 是否填充
     */
    private boolean isPadding;

    public SM4Context(int mode) {
        this();
        this.mode = mode;
    }

    public SM4Context() {
        this.isPadding = true;
        this.sk = new long[32];
    }

    public void setMode(int mode) {
        this.mode = mode;
    }

    public int getMode() {
        return mode;
    }

    public boolean isPadding() {
        return isPadding;
    }

    public void setPadding(boolean padding) {
        isPadding = padding;
    }

    public long[] getSk() {
        return sk;
    }
}